﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<%= TempData["Message"]%>
    <div id="cactionbutton">
        <button type="button" id="btnRefesh" title="Làm mới" class="button refresh">Làm mới</button> 
        <button type="button" id="btnDelete" title="Xóa" class="button delete">Xóa</button>
    </div>
    <div id="cfilter">
            <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <%=Html.AutoCompleteTextBox("txtKeyword", "Nhập họ tên", "RegisterCard", true)%>
                        
                    </td>
                    <td>
                        Từ ngày
                    </td>
                    <td>
                        <%=Html.DatePicker("FromDate")%>
                        
                    </td>
                    <td>
                        Đến ngày
                    </td>
                    <td>
                        <%=Html.DatePicker("ToDate")%>
                    </td>
                    <td>
                        <button type="button" id="btnFilter" title="Filter" class="button filter">Lọc</button>
                        
                    </td>
                </tr>
            </table>
    </div>
    <div class="clist">
        <table id="list" class="scroll">
        </table>
        <div id="pager" class="scroll" style="text-align: center;">
        </div>
    </div>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageTitle" runat="server">
    Thông tin đăng ký sở hưu thẻ
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        jQuery(document).ready(function () {
            JS_LIB.onEnterKeyword();
            // refresh button
            $("#btnRefesh").click(function () {
                window.location = "/Administration/OwnerStudentCard";
            });
            // filter button
            $("#btnFilter").click(function () {
                var name = encodeURIComponent($('#txtKeyword').val());
               
                if (name == encodeURIComponent('Nhập họ tên')) {
                    name = "";
                }
                
                $('#list').setGridParam({ url: '/Administration/OwnerStudentCard/GetListJQGrid?keyword=' + name + '&from_date=' + $('#FromDate').val() + '&to_date=' + $('#ToDate').val()
                }).trigger('reloadGrid');
            });
            // delete button           
            $("#btnDelete").click(function () {
                JS_LIB.deletes('#list', 'ID', '/Administration/OwnerStudentCard/DeleteList');
            });
        });
    </script>
    <%  
        TSV.Library.Controls.GridViewControls grid = new TSV.Library.Controls.GridViewControls();
        grid.Width = 1200;
                
        string[] colNames = { "Stt", "ID", "Họ & Tên", "Giới tính", "Địa chỉ","Nơi nhận thẻ", "Email", "Điện thoại","Ngày đk", "Chức năng" };
        string[] colModels = {  "{ name: 'No', index: 'ID', align: 'center', width: 20}",
                                "{ name: 'ID', index: 'ID', align: 'center', width: 50,hidden: true}",
                                "{ name: 'FullName', index: 'FullName', align: 'left', width: 120, sortable: true }",
                                "{ name: 'Gender', index: 'Gender', align: 'center', width: 35, sortable: false }",
                                "{ name: 'ContactAddress', index: 'ContactAddress', align: 'left', width: 170, sortable: true }",
                                "{ name: 'ReceiveAddress', index: 'ContactAddress', align: 'left', width: 170, sortable: true }",
                                "{ name: 'Email', index: 'Email', align: 'left', width: 130, sortable: true }",
                                "{ name: 'Phone', index: 'Phone', align: 'center', width: 55, sortable: true }",
                                "{ name: 'CreateDate', index: 'CreateDate', align: 'center', width: 60, sortable: true }",
                                "{ name: 'Action', index: 'Action', editable: false, width: 42, align: 'center', sortable: false}"
                            };

        Response.Write(grid.ShowGrid("/OwnerStudentCard/GetListJQGrid/", colNames, colModels));
    %>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ModuleName" runat="server">
   Thông tin đăng ký sở hưu thẻ
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="FunctionTitle" runat="server">
   Thông tin đăng ký sở hưu thẻ
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="LoginRoles" runat="server">
</asp:Content>
